<template>
	<view class="container">
		<cu-header bgColor="bg-gradual-blue" :isBack="true">
			<block slot="content" class="page-name">操作条</block>
		</cu-header>
		<view class="contents">
			<view class="cu-card padding">
				<view>正在请求...</view>
			</view>
			<button @click="onCommit">立即请求</button>
		</view>
		<cu-more title="已没有更多内容咯"></cu-more>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	import {
		onHome
	} from '@/utils/api.js'
	export default {
		computed: {
			...mapState(['hasLogin', 'forcedLogin', 'userinfo'])
		},
		components: {

		},
		data() {
			return {
				shareinfo: {
					title: 'ColorUI-Plus',
					desc: '邀请您体验透明装修',
					path: 'https://www.homeeyes.cn/app/livedemo/downloadapk.html',
					logo: 'https://www.homeeyes.cn/app/images/icon_logo.png'
				}
			};
		},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function(res) {
			if (res.from === 'button') {
				// 来自页面内分享按钮
				console.log(res.target);
			}
			return this.shareinfo;
		},
		onLoad() {

		},
		onShow() {
			this.onInit();
		},
		methods: {
			...mapMutations(['logout', 'login', 'loginsoure']),
			onInit: function() {
				let that = this;

			},
			onCommit: function(e) {
				onHome().then((res) => {
					console.log(res);
				}).error((err) => {
					console.log(err);
				})
			}
		}
	}
</script>

<style scoped>

</style>
